package com.df.bpm.utils;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

@Getter
@Setter
@Data
@Accessors(chain = true)
public class PolygonTemp {

    @Schema(description = "范围x坐标组")
    double [] rangeX;
    @Schema(description = "范围y坐标组")
    double [] rangeY;
    @Schema(description = "目标x坐标组")
    double [] targetX;
    @Schema(description = "目标y坐标组")
    double [] targetY;

    @Schema(description = "确认结果")
    boolean [] isInPolygon;

    @Schema(description = "是否输出图片")
    boolean drawImage=false;

    @Schema(description = "结果图片")
    byte [] image;

    @Schema(description = "结果图片中目标点是否可见")
    boolean targetsVisible;

    @Override
    public String toString() {
        ObjectMapper mapper = new ObjectMapper();
        try {
            return mapper.writeValueAsString(this);
        } catch (JsonProcessingException e) {
            throw new RuntimeException(e);
        }
    }
}
